<%@page import="java.util.ArrayList"%>
<%@page import="cn.edu.thsis.pojo.newsinfo"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewpoit" content="width=device-width,initial-scale=1">
    <meta name="renderer" content="webkit">
    <title>毕业论文选题系统-主页</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/animate.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/plugins/iCheck/custom.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/plugins/steps/jquery.steps.css">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!--公告标题开始-->
    <div class="row">
        <div class="col-sm-5">
            <div class="jumbotron">
                <h1>公告</h1>
                <p>该网站用于学生论文（设计）题目的选择。</p>
                <p><a href="https://www.qlit.edu.cn" target="_blank" class="btn btn-primary btn-lg" role="button">学校主页</a>
                </p>
            </div>
        </div>
        <div class="col-sm-7">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>毕业论文基本流程</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <p> 毕业论文（设计）的几个基本步骤流程
                    </p>
                    <div id="wizard">
                        <h1>第一步</h1>
                        <div class="step-content">
                            <div class="text-center m-t-md">
                                <h2>撰写开题报告和任务书</h2>
                                <p>这是在论题确认之后需要做的首要任务</p>
                            </div>
                        </div>

                        <h1>第二步</h1>
                        <div class="step-content">
                            <div class="text-center m-t-md">
                                <h2>制做毕业设计和撰写毕业论文</h2>
                                <p>在设计和撰写中期需要交中期检查表以确认完成进度</p>
                            </div>
                        </div>

                        <h1>第三步</h1>
                        <div class="step-content">
                            <div class="text-center m-t-md">
                                <h2>进行毕业答辩</h2>
                                <p>完成项目并对自己的项目进行答辩</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--公告标题结束-->
    <!--公告列表开始-->
    <div class="row">
        <div class="col-lg-4">
        <%
        List<newsinfo> niList = (ArrayList<newsinfo>)request.getAttribute("niList");
        for(newsinfo ni:niList){
        %>
            <div class="ibox">
                <div class="ibox-content">
                    <a href="${pageContext.request.contextPath}/NewsInfo?oper=newcont&nid=<%=ni.getNid() %>"><h2><%=ni.getTitle()%></h2></a>
                    <div class="small m-b-xs">
                                                             发布人：<small><%=ni.getAuthor()%></small>
                    </div>
                    <p><%=ni.getSummary()%></p>
                    <div class="row">
                        <div class="col-md-4 col-md-offset-8">
                            <div class="small text-right">
                             <%out.print(ni.getCreateDate()); %></div>
                        </div>
                    </div>
                </div>
            </div>
        <%}%>
        </div>
    </div>
    <!--公告列表结束-->
</div>

<!-- 全局js -->
<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/content.js"></script>

<!-- Steps -->
<script src="${pageContext.request.contextPath}/js/plugins/staps/jquery.steps.min.js"></script>

<!-- Jquery Validate -->
<script src="${pageContext.request.contextPath}/js/plugins/validate/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/js/plugins/validate/messages_zh.min.js"></script>


<script>
    $(document).ready(function () {
        $("#wizard").steps();
        $("#form").steps({
            bodyTag: "fieldset",
            onStepChanging: function (event, currentIndex, newIndex) {
                // Always allow going backward even if the current step contains invalid fields!
                if (currentIndex > newIndex) {
                    return true;
                }

                // Forbid suppressing "Warning" step if the user is to young
                if (newIndex === 3 && Number($("#age").val()) < 18) {
                    return false;
                }

                var form = $(this);

                // Clean up if user went backward before
                if (currentIndex < newIndex) {
                    // To remove error styles
                    $(".body:eq(" + newIndex + ") label.error", form).remove();
                    $(".body:eq(" + newIndex + ") .error", form).removeClass("error");
                }

                // Disable validation on fields that are disabled or hidden.
                form.validate().settings.ignore = ":disabled,:hidden";

                // Start validation; Prevent going forward if false
                return form.valid();
            },
            onStepChanged: function (event, currentIndex, priorIndex) {
                // Suppress (skip) "Warning" step if the user is old enough.
                if (currentIndex === 2 && Number($("#age").val()) >= 18) {
                    $(this).steps("next");
                }

                // Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
                if (currentIndex === 2 && priorIndex === 3) {
                    $(this).steps("previous");
                }
            },
            onFinishing: function (event, currentIndex) {
                var form = $(this);

                // Disable validation on fields that are disabled.
                // At this point it's recommended to do an overall check (mean ignoring only disabled fields)
                form.validate().settings.ignore = ":disabled";

                // Start validation; Prevent form submission if false
                return form.valid();
            },
            onFinished: function (event, currentIndex) {
                var form = $(this);

                // Submit form input
                form.submit();
            }
        }).validate({
            errorPlacement: function (error, element) {
                element.before(error);
            },
            rules: {
                confirm: {
                    equalTo: "#password"
                }
            }
        });
    });
</script>

</body>
</html>